/**
 * 功能描述 总表格触发事件
 */
define(function (require, exports, module) {
	var DetailGrid = require("grid");
	
    module.exports = {
    	gridMx : function(data, widget){
            var detailgrid = new DetailGrid({
            	parentNode : ".J-detailgrid",	
            	url : "api/welfareconsumptioncoupondetail/query",
            	autoRender : false,
//            	show : false,
				params : function(){
					var subnav = widget.get("subnav");
//					删除多余的div
					$("div[class='container el-grid el-grid-2 hidden']").remove();
					var obj = {
							"welfareConsumptionCoupon" : data.pkWelfarecc,
                			"servicePoint" : subnav.getValue("servicePoint"),
                			"operateDate" : subnav.getValue("operateDate").start,
                			"operateDateEnd" : subnav.getValue("operateDate").end,
                			fetchProperties : "*,operator.name,welfareConsumptionCoupon.balance"
                	};
	    			return obj;
				},
				model : {
				 columns  : [{
					 name : "operateDate",
					 label : "时间",
					 format : "date",
				 },{
					 name : "operateStatus.value",
					 label : "类型",
				 },{
					 name : "price",
					 label : "金额(元)",
				 },{
					 name : "welfareConsumptionCoupon.balance",
					 label : "余额(元)",
				 },{
					 name : "operator.name",
					 label : "操作人员",
				 },{
					 name : "remarkDetail",
					 "break" : true,
					 label : "备注",
				 }]
				}
            });
            widget.set("detailgrid", detailgrid);
        },
    };
});
